/**
 * 十六进制转换为十进制 Integer.parseInt(str,16)
 * @author 汪林
 * @date 2020/9/22 18:20
 */
public class TestDemo {
    public static void main(String[] args) {
        //String str = "13abf";
        String str = "bf";
        int len = str.length();
        int sum = 0;
        for(int i=0;i<len;i++){
            char c = str.charAt(len-1-i);
            int n = Character.digit(c,16);
            sum += n * (1<<(4*i));
        }
        System.out.println(sum);
    }
}
